import { loadReportDataOfSummaryCompanyElectricity } from '@/api/modules/dataReport'
import type { LoadDataResponse } from './type'
import type { REPORT_FORM_ID } from '@/enum'

export default function useLoadReportDetail() {
  const res = shallowRef<LoadDataResponse>()
  async function loadReportData(time: string, formId: REPORT_FORM_ID) {
    const { data } = await loadReportDataOfSummaryCompanyElectricity(time, formId)
    res.value = data
    return data
  }

  return {
    res,
    loadReportData,
  }
}
